package icasue.stronger.wareable.nameconvert;

import java.util.function.Function;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2020/7/3 上午9:58
 * @UpdateDate:
 * @Description:
 */
public class DefaultBeanNameTransFor implements BeanNameTransFor {

    private static final String SUFFIX = "_SPRING_BEAN_STORE";

    @Override
    public Function<String, String> transForTo() {
        Function<String, String> transForFunction = (originName) -> {
            return originName + SUFFIX;
        };
        return transForFunction;
    }

    @Override
    public Function<String, String> transForBack() {
        Function<String, String> transBackFunction = (transName) -> {
            return transName.substring(0,transName.indexOf("_"));
        };
        return transBackFunction;
    }
}
